<template>
    <div class="body_background" :style="GetWindowBackground">
        <div class="body_background padding-top10">
            <div class="block-box">
                <div class="title-box">
                    <div class="big-font-size three-color">基础信息</div>
                </div>
                <ul class="create-box">
                    <li>
                        <div class="big-font-size main-color white-space">商品图片：</div>
                        <img src="../../assets/img/personal.png">
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">商品名称：</div>
                        <div class="three-color">刘啊丹</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">商品规格：</div>
                        <div class="three-color">120g</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">商品分类：</div>
                        <div class="three-color">卤味</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">商品平均进价：</div>
                        <div class="price-color">￥200</div>
                    </li>
                </ul>
            </div>
            <div class="block-box items-start">
                <div class="big-font-size three-color">仓储信息</div>
                <ul class="create-box">
                    <li>
                        <div class="big-font-size main-color white-space">库存：</div>
                        <div class="three-color">200袋</div>
                    </li>
                </ul>
            </div>
            <div class="block-box items-start">
                <div class="big-font-size three-color">报损信息</div>
                <ul class="create-box">
                    <li>
                        <div class="big-font-size main-color white-space">报损数量(袋)：</div>
                        <input type="text" class=""/>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">报损金额(元)：</div>
                        <input type="number" class=""/>
                    </li>
                </ul>
            </div>
            <div class="block-box items-start mar">
                <div class="big-font-size main-color">报损原因</div>
                <textarea class="note-content" placeholder="请输入报损原因"></textarea>
            </div>

            <div class="button-box body_background">
                <mt-button class="width40 middle-font-size"
                           @click="cancelFun"
                >取消</mt-button>
                <mt-button class="width40 middle-font-size background white-color"
                           @click="submitFun"
                >提交</mt-button>
            </div>
        </div>
    </div>
</template>

<script>

    export default {
        name: "StockLossReportSub",
        data() {
            return {
                id: '',
                GetWindowBackground: {
                    'min-height': ''
                },
            }
        },
        mounted() {
            this.id = this.$route.query.id;
            console.log(this.id)
        },
        methods: {
            //查看更多订单
            lookMoreOrder(item) {
                this.goodsShow = !this.goodsShow
            },
            //取消
            cancelFun(item) {
                this.$router.push('/StockGoodsDetail')
            },
            //提交
            submitFun(item) {
                this.$router.push('/StockGoodsDetail')
            },
            getBodyHeight() {
                // 获取浏览器高度，减去顶部搜索栏和导航栏的值 55 + 50（可动态获取）,再减去底部高度值60
                this.GetWindowBackground['min-height'] = window.innerHeight + 'px'
            },
        },
        // 生命周期 - 创建完成（可以访问当前this实例）
        created() {
            window.addEventListener('resize', this.getBodyHeight) // 注册监听器
            this.getBodyHeight() // 页面创建时先调用一次
        },
        // 生命周期 - 销毁完成
        destroyed() {
            window.removeEventListener('resize', this.getBodyHeight)
        },
    }
</script>

<style lang="scss" scoped>

    .padding-top10 {
        padding-top: 15px;
    }

    .block-box {
        width: calc(100% - 60px);
        padding: 20px 20px 0 20px;
        border-radius: 8px;
        margin-bottom: 15px;
    }


    .title-box{
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .create-box {
        width: 100%;
        padding-bottom: 10px;
        padding-top: 10px;
        li {
            width: 100%;
            display: flex;
            padding: 10px 0;
            align-items: center;
            img{
                width: 80px;
                height: 80px;
            }
            div{
                margin-bottom: 7px;
            }
            .three-color {
                width: calc(100% - 100px);
                text-align: left;
            }
            input{
                width: calc(100% - 100px);
                height: 30px;
                border-top:0;
                border-left:0;
                border-right:0;
                border-bottom: 1px solid #ebedf1;
                outline: none;
                list-style: none;
            }
        }
    }
    .note-content{
        width: calc(100% - 20px);
        border-radius: 6px;
        border: 1px solid #eef0f3;
        margin: 8px 0 25px 0;
        text-align: left;
        font-size: 13px;
        padding: 10px;
        outline: none;
        list-style: none;
    }

    .button-box {
        width: calc(100% - 20px);
        height: 50px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0px;
        border: 10px solid #f5f6fa;
        .width40 {
            width: 40%;
            border: 1px solid #05c569;
            color: #05c569;
            border-radius: 10px;
        }
    }
    .mar{
        margin-bottom: 80px;
    }


</style>